package day07test;

import java.util.Random;
import java.util.Scanner;

public class test1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Random r = new Random();
        int randomNumber = r.nextInt(100)+1;
        System.out.println(randomNumber);
        while (true) {
            System.out.println("请输入你猜的数字");
            int inputNumber = sc.nextInt();
            if (inputNumber > randomNumber){
                System.out.println("猜大了");
            }else if (inputNumber < randomNumber){
                System.out.println("猜小了");
            }else {
                System.out.println("猜中了");
                break;
            }
        }

    }
}
